using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace sCicero
{
    public partial class settings_edit : Form
    {
        private sCicero.scicero m_osCicero;
        private sCicero.Data m_oData;

        public settings_edit(ref sCicero.scicero osCicero, ref sCicero.Data oData)
        {
            InitializeComponent();
            m_osCicero = osCicero;
            m_oData = oData;
            checkBox_averagegrade.Checked = bool.Parse(m_oData.GetGenericDataTable("settings").Rows.Find("showaveragegrade").ToString());
            //checkBox_averagegrade.Checked = m_oData.
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataRow o_Dr = m_oData.GetGenericDataTable("settings").Rows.Find("showaveragegrade");
            o_Dr["value"] = checkBox_averagegrade.Checked ? "1" : "0";
            m_oData.AcceptChanges("settings");
            this.Close();
        }


    }
}